home *** CD-ROM | disk | FTP | other *** search
/ MacGames Sampler / PHT MacGames Bundle.iso / MacSource Folder / Samples from the CD / Add-ons / CAfterDark20 / CAfterDark.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-03  |  2.8 KB  |  104 lines  |  [TEXT/KAHL]

  1. /*
  2.  * © Copyright Jeff Francis 1990
  3.  * All rights reserved
  4.  *
  5.  * $Id$
  6.  *
  7.  * Description - CAfterDark is a base class for developing graphics
  8.  * modules for After Dark.  This class defines the default behaviour
  9.  * for all graphics module classes.  Subclasses can add additional
  10.  * behaviour.  Page references are to "After Dark Programmer's Manual."
  11.  *
  12.  * NOTE - The GlueCode WILL LOCK DOWN the "this" pointer before it
  13.  * sends any messages to the object.  This way, you don't have to
  14.  * worry about assignment to instance variables and passing to them
  15.  * to functions.  For more information on this see Curt Bianchi's 
  16.  * "Using Objects Safely in Object Pascal" develop, April 1990.
  17.  * Altough this paper applies to Object Pascal, Object C works
  18.  * about the same way.
  19.  *  
  20.  */
  21.  
  22. #include "CAfterDark.h"
  23.  
  24. /*
  25.  * Initialize does nothing.  Subclasses should override this method to
  26.  * initialize any instance variables and setup the initial state of the
  27.  * graphics module.  If your class contains instance variables that need
  28.  * to be newed, then new them here.  Be sure to delete them when you
  29.  * receive the Close message.
  30.  * (Page 17 - initialize)  
  31.  */
  32. OSErr CAfterDark::Initialize(RgnHandle blankRgn, GMParamBlockPtr params)
  33. {
  34.     return noErr;
  35. }
  36.  
  37.  
  38. /*
  39.  * Blank fills the blankRgn with black thus blanking the screen(s).
  40.  * (Page 18 - blank)
  41.  */
  42. OSErr CAfterDark::Blank(RgnHandle blankRgn, GMParamBlockPtr params)
  43. {
  44.     FillRgn(blankRgn, params->qdGlobalsCopy->qdBlack);
  45.     return noErr;
  46. }
  47.  
  48.  
  49. /*
  50.  * DrawFrame does nothing.  Subclasses should override this method
  51.  * to perform their animation.
  52.  * (Page 18 - DrawFrame)
  53.  */
  54. OSErr CAfterDark::DrawFrame(RgnHandle blankRgn, GMParamBlockPtr params)
  55. {
  56.     return noErr;
  57. }
  58.  
  59.  
  60. /*
  61.  * Close does nothing.  Subclasses should override this method
  62.  * to release any memory allocated by their subclass and to clean
  63.  * things up before closing.  NOTE: you shouldn't delete the
  64.  * instance of your object (i.e., this) because the GlueCode will
  65.  * do it for you.
  66.  * (Page 18 - Close)
  67.  */
  68. OSErr CAfterDark::Close(RgnHandle blankRgn, GMParamBlockPtr params)
  69. {
  70.     return noErr;
  71. }
  72.  
  73.  
  74. /*
  75.  * ButtonMessage does nothing.  Subclasses should override this method to
  76.  * handle button messages.
  77.  * (Page 18 - ButtonMessages)
  78.  */ 
  79. OSErr CAfterDark::ButtonMessage(RgnHandle blankRgn, GMParamBlockPtr params, eMessage message)
  80. {
  81.     return noErr;
  82. }
  83.  
  84.  
  85. /*
  86.  * ModuleSelected does nothing.  Subclasses should override this method
  87.  * to setting up the module's control panel.
  88.  * (Page 18 - ModuleSelected)
  89.  */ 
  90. OSErr CAfterDark::ModuleSelected(RgnHandle blankRgn, GMParamBlockPtr params)
  91. {
  92.     return noErr;
  93. }
  94.  
  95.  
  96. /*
  97.  * DoHelp does nothing.  Subclasses should override this method to
  98.  * perform application specific Help dialogs.
  99.  * (Page 18 - DoHelp)
  100.  */ 
  101. OSErr CAfterDark::DoHelp(RgnHandle blankRgn, GMParamBlockPtr params)
  102. {
  103.     return noErr;
  104. }